//
//  CarpoolWithFriendsServer.m
//  CarpoolWithFriends
//
//  Created by Yang Lu on 4/27/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "CarpoolWithFriendsServer.h"

@implementation CarpoolWithFriendsServer

//static NSString *gServerAddress = @"http://23.21.156.57/CarpoolWithFriends/";
static NSString *gServerAddress = @"http://127.0.0.1:8000/";
static NSURL *gServerURL;
static NSString *gUserID;

+(NSString*)getServerAddress
{
    return gServerAddress;
}

+(NSURL*)getServerURL:(NSString*)apiName queryString:(NSString*)custQueryStr
{
    NSString *tempStr = gServerAddress;
    if(apiName != nil) {
        tempStr = [NSString stringWithFormat:@"%@%@/", tempStr, apiName];
    }
    if(custQueryStr != nil) {
        tempStr = [NSString stringWithFormat:@"%@?%@", tempStr, custQueryStr];
    }
    
    gServerURL = [NSURL URLWithString:tempStr];
    return gServerURL;
}

+(NSString*)getUserID
{
    return gUserID;
}

+(void)setUserID:(NSString*)userID
{
    [gUserID initWithString:userID];
}
@end
